home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 22 / Mac Magazin and MacEasy Magazine CD - Issue 22.iso / Wissenschaft & Technik / MandelBrain 1.0b24 68K Folder / Read Me < prev    next >
Text File  |  1996-01-07  |  13KB  |  196 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. MandelBrain 1.0ß24
  17. Copyright © 1995-96 Danny Brewer
  18.  
  19. What is it?
  20.  
  21. MandelBrain is a program for Macintosh computers that displays color images of a mathematical object, a fractal called the Mandelbrot set.
  22.  
  23. MandelBrain is provided in three seperate versions for different configurations.  MandelBrain is designed to run on Power Macintosh computers using the PowerPC microprocessor.  A seperate version of the program will walk on 68K Macs with an FPU, and yet another version of the program will crawl on 68K Macs without an FPU.
  24.  
  25. Although the program is FREE, it is Copyright © 1995-96 Danny Brewer.  See below for more information, restrictions, and a lack of warranty and disclaimer of liability, including a disclaimer of any liability for personal injury or death if it were to result from or arise out of use of the software.  By using this program you agree to the disclaimer of warranty and liability and assume all risk associated with use of the program.
  26.  
  27.  
  28. System Requirements
  29.  
  30. MandelBrain requires
  31.     • System 7
  32.     • Color QuickDraw
  33.     • a color monitor with at least 256 colors
  34.     • plenty of memory (at least 3 MB free)
  35.  
  36.  
  37. Features
  38.  
  39. MandelBrain is friendly and easy to use.  (Plus it's FREE.)  It has most basic Macintosh features that you expect such as:
  40.  
  41. • the ability to open multiple windows which are resizable, scrollable and zoomable.
  42. • each window is a document with the standard save/close/open/revert commands.
  43. • autoscrolling when you drag the selection fence out of the window
  44. • stationery documents
  45. • copy all or part of the displayed image to the clipboard
  46. • the ability to save a PICT file of the displayed image
  47. • active scrolling (i.e. when you drag the scroll bar thumb, the window contents scroll)
  48.  
  49. In addition to these general features, MandelBrain features:
  50.  
  51. • Background calculation
  52. • Color table animation, even on monitors using thousands or millions of colors.
  53. • The ability to clone a window so you can experiment with it in several different ways.
  54.  
  55. MandelBrain features a number of optimizations to improve its performance.
  56.  
  57. • Maraini/Silver “eat my dust” divide and conquer algorithm
  58. • Loop unrolling
  59. • Cycle detection
  60. • Mirror reflection around the x-axis to exploit the Mandelbrot set's symmetry.
  61.  
  62. After briefly experimenting with several Mandelbrot programs for the PowerMac, I was motivated to write Mandelbrain.  Several of these programs had excellent performance, but lacked much in the way of basic user interface features.  Furthermore, they often took over the machine while calculating in order to achieve their high performance.
  63.  
  64.  
  65. Color Table Animation
  66.  
  67. The color table animation feature works best on a monitor set to 256 colors that can support hardware color table animation.  But on other monitors, color animation is achieved by repeatedly copying the pixels to the screen.  Therefore, on monitors that don't support hardware color table animation, the animation still works, but performance will slow down with larger and larger images, or if you have several windows trying to animate at the same time.
  68.  
  69.  
  70. How to use MandelBrain
  71.  
  72. See a separate document “How to use MandelBrain” for a brief description of how to use the major features of MandelBrain.
  73.  
  74.  
  75. Future Plans
  76.  
  77. I intend to continue to develop MandelBrain, as time and inspiration allows, I would like to eventually add the following major features.
  78.  
  79. • The ability to create a QuickTime movie of a zoom into the Mandelbrot set.
  80. • More ways to color the Mandelbrot set.  (i.e. binary decomposition, etc.)
  81. • A way to distribute the computation load across multiple Macintosh CPU's on a network.
  82. • Deeper diving into the Mandelbrot set by using a larger floating point type.
  83. • The ability to suspend and then later restart a long calculation.  For example, it may take weeks or months to calculate a QuickTime movie, but you may not want to leave MandelBrain running for this long at a stretch.
  84.  
  85. There are other minor features I would like to add.
  86.  
  87. • A mode to hog the CPU and not give time to other programs.
  88. • An option to save precalculated pixels into the document when you save it so that it opens much faster, but uses much more disk space.
  89. • Device Loop support so that the image is drawn in the best possible way on each monitor when the window crosses multiple monitors.
  90. • Printing
  91.  
  92. Other interesting features further down my wish list:
  93.  
  94. • color table editor
  95. • ability to save a GIF or JPEG file
  96.  
  97.  
  98. Technical details
  99.  
  100. MandelBrain likes lots of memory.  It's default partition is set to about 3 MB.  Of course if you want to simultaneously calculate a bunch of large 1024x1024 images, you'll need to give it more memory.
  101.  
  102. The program has some error handling.  It is not really good with low-memory situations yet.  It should not crash, but it may behave erratically.  [Geek talk:  it always checks for nil pointers and handles before dereferencing them, but some memory allocations are not checked yet.]
  103.  
  104.  
  105. Performance
  106.  
  107. One thing I've tried to pay attention to in this program is performance.  I compared MandelBrain's performance with several other Mandelbrot programs that ran on a Power Mac.  MandelBrain's performance is on a par with the fastest of these programs.
  108.  
  109. While having good performance, MandelBrain calculates in the background.  On a Power Mac it is even quite cpu-friendly when trying to do other work with MandelBrain in the background.
  110.  
  111. I haven't done any optimizations specifically for 680x0 Macs, although they generally benefit from the optimizations I've done for the Power Mac.
  112.  
  113. If you are not a computer geek, you might want to skip over some of the following material.
  114.  
  115. The following are some of the lessons learned and techniques I used to improve performance.
  116.  
  117. • Low initial MaxDwell setting.  (It starts out with a very small value of 10,000 on a Power Mac, and an extremely tiny value of 500 on a 68030 Mac.)
  118. • Divide and conquer calculation approach.
  119. • It doesn't blit to the screen every time it has some new pixels to blit, yet it blits often enough to give the user a sense of progress.  (This turned out to be a big-win!  QuickDraw may blit fast, but it apparently has a lot of setup overhead.)
  120. • Profiling the code.  Despite having instinctively felt that I knew where the performance bottlenecks were, I discovered a few things I didn't expect after profiling the code.
  121. • Custom blitting code to write to an offscreen GWorld and then use CopyBits to get it on the screen.
  122. • Loop unrolling of the main Mandelbrot calculation loop.  On the Power Mac and the 680x0+FPU version 100 iterations of the loop are unrolled.  On the 680x0 without FPU version only 70 iterations are unrolled due to 16-bit offset branch displacement limitations.  This also caused noticeable bloat of the 680x0 code.
  123. • Check rectangles to see if they can be filled with a solid color.  (This was a big win.)
  124. • Check only every 3rd pixel around the edges of a rectangle to see if it can be filled with a solid color.  (This was a medium sized win.)
  125. • Detect orbits that end up in a cycle.  Once a cycle is detected, you can bail out instantly knowing that it will iterate infinite times without performing the rest of the iterations up to MaxDwell.  (This resulted in a noticeable improvement.)
  126.  
  127. Things I did not do to improve performance:
  128.  
  129. • I did not write _any_ assembly language.
  130. • Didn't do any analysis to determine the optimum maximum cycle period to detect.  The smaller the cycle detector's maximum period, the sooner you detect short cycles which appear to occur with greater frequency.  [I haven't verified this.... but...]  But the longer the cycle's detector's maximum period, the longer of cycles it is able to detect, and therefore a larger number of pixels are able to avoid iterating all the way up to MaxDwell.  This saves iterations for more pixels, but it takes longer to detect a cycle, even a short cycle, so there must be a balance somewhere.
  131.  
  132.  
  133. It's Free!   It has distribution restrictions.
  134.  
  135. MandelBrain is FREE.
  136.  
  137. MandelBrain may not be sold.  [Hey, I wrote it and I'm not making any money off it!]
  138.  
  139. MandelBrain may not be included with a commercial product without my express written permission.  [Hint:  it's probably not too difficult to get permission for reasonable uses, and even if you're not sure, it's probably worth asking.]
  140.  
  141. Permission is hereby expressly granted for
  142.     • FTP site operators
  143.     • online services
  144.     • publishers of freeware / shareware compilations on CD-ROM or similar media
  145.     • operators of both pay and free BBS systems
  146.  to distribute MandelBrain without any compensation to me, provided it is distributed unmodified along with this documentation.
  147.  
  148. Naturally, you may do anything whatsoever with images that you create using MandelBrain.  It would be nice if you mentioned that MandelBrain was used to generate the image.
  149.  
  150. Publishers of CD-ROM compilations: it would be nice if you would send me a complimentary copy of your CD if you include MandelBrain, or offer me a discount on the purchase price, but there is no requirement to do so.
  151.  
  152. If anyone really wants to send money ($5) for this program, I'll gladly take it. :-)  In this case, contact me, and I'll tell you how.
  153.  
  154. MandelBrain has no warranty expressed or implied.  By using MandelBrain, you agree to the disclaimer of warranty which appears at the end of this document, as well as a disclaimer of liability for personal injury or death if it were to result from the use of this software.
  155.  
  156.  
  157. The Author
  158.  
  159. Danny Brewer
  160. danny@cjnetworks.com
  161. http://www.cjnetworks.com/~danny
  162.  
  163. You can contact me at danny@cjnetworks.com.  I would like to hear the good, the bad and the ugly from anyone who tries, uses, loves or hates this program.
  164.  
  165. I can't guarantee to respond to any mail or suggestions, or fix any bugs.  [Translation: if I get 98,124 messages in my mailbox overnight, I won't be sending out responses.]
  166.  
  167. The most current version of MandelBrain is at http://www.cjnetworks.com/~danny.  Note that the most current version stored here may not be a “final” release version, but may be a ßeta test version.
  168.  
  169. If for some reason you can't reach me at danny@cjnetworks.com, then you can try meow3mix@aol.com;  but please be aware that I don't check my mail on AOL every day.  Alternatively you could try danny@tyrell.net.
  170.  
  171. MandelBrain was written in my spare evenings and sundays from July thru October 1995.  A little bit of new code was added in November and December.
  172.  
  173.  
  174. MandelBrain has no warranty
  175.  
  176. By using MandelBrain you agree to the following.
  177.  
  178. For the purposes of this document, MandelBrain and all accompanying documentation shall be referred to as “The Software”.
  179.  
  180. The Software is provided as-is.  There are no warranties, expressed or implied.  There is no promise of any kind of technical support or product support.
  181.  
  182. DANNY BREWER MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE.
  183.  
  184. DANNY BREWER DISCLAIMS ALL WARRANTIES RELATING TO THE SOFTWARE, WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OR MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND ALL SUCH WARRANTIES ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED.  NETHER DANNY BREWER, NOR ANYONE ELSE WHO HAS BEEN INVOLVED IN THE DEVELOPMENT, CREATION, PRODUCTION, OR DELIVERY OF THE SOFTWARE SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR SPECIAL DAMAGES RESULTING FROM OR ARISING OUT OF THE USE, MISUSE OR INABILITY TO USE THE SOFTWARE EVEN IF THE PARTIES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS.  THE PARTIES ALSO DISCLAIM ALL LIABILITY TO THE MAXIMUM EXTENT PERMITTED BY LAW FOR PERSONAL INJURY OR DEATH RESULTING FROM OR ARISING OUT OF THE USE, MISUSE OR INABILITY TO USE THE SOFTWARE.  IN NO EVENT SHALL THE PARTIES' LIABILITY FOR ANY DAMAGES EVER EXCEED THE PRICE PAID FOR THE SOFTWARE REGARDLESS OF THE FORM OF CLAIM.  THE PERSON USING THE SOFTWARE BEARS ALL RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE.
  185.  
  186. THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE ON A COMPUTER BEING USED AS ON-LINE CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES"). DANNY BREWER SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. 
  187.  
  188. THE SOFTWARE IS PROVIDED GRATUITOUSLY AND, ACCORDINGLY, NETHER DANNY BREWER, NOR ANYONE ELSE WHO HAS BEEN INVOLVED IN THE DEVELOPMENT, CREATION, PRODUCTION, OR DELIVERY OF THE SOFTWARE SHALL BE LIABLE UNDER ANY THEORY FOR ANY DAMAGES SUFFERED BY YOU OR ANY USER OF THE SOFTWARE.
  189.  
  190. Some states do not allow the exclusion of the limit of liability for consequential or incidental damages, so some of the above limitations may not apply to you.
  191.  
  192. This agreement shall be governed by the laws of the State of Kansas.  Any action or proceeding brought by either party against the other arising out of or related to this agreement shall be brought only in a state or federal court of competent jurisdiction located in Kansas.
  193.  
  194.  
  195.  
  196.